package com.luo.dao.impl;

import com.luo.dao.DetailsMappers;
import com.luo.dao.GoodMappers;
import com.luo.model.GoodPictures;
import com.luo.model.Goods;
import com.luo.model.Properties;
import com.luo.util.SqlSessionUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * 功能：商品信息说明的查询
 * 作者：Luo。
 * 日期：2024/1/22 19:55
 */
public class DetailsDaoImpl implements DetailsMappers {
    @Override
    public List<Properties> queryPropByGoodId(String id) {
        SqlSession sqlSession = SqlSessionUtil.getSqlSession();
        DetailsMappers mapper = sqlSession.getMapper(DetailsMappers.class);
        List<Properties> properties = mapper.queryPropByGoodId(id);
        sqlSession.close();
        return properties;
    }

    @Override
    public List<GoodPictures> queryIntroducePicture(final String id) {
        SqlSession sqlSession = SqlSessionUtil.getSqlSession();
        DetailsMappers mapper = sqlSession.getMapper(DetailsMappers.class);
        List<GoodPictures> goodPictures = mapper.queryIntroducePicture(id);
        sqlSession.close();
        return goodPictures;
    }
}
